import sequelize from "sequelize";
import db from "../database";

const banners = db.define(
  "banners",
  {
    id: {
      type: sequelize.INTEGER, //int类型
      autoIncrement: true, //自增
      allowNull: false, //不为空
      field: "id", //表映射
      primaryKey: true,
    },
    url: {
      type: sequelize.STRING(100),
      allowNull: false,
      field: "url",
    },
    title: {
      type: sequelize.STRING(100),
      allowNull: false,
      field: "title",
    },
    isdeleted: {
      type: sequelize.BOOLEAN,
      allowNull: false,
      defaultValue: false,
      field: "isdeleted",
    },
  },
  { timestamps: true }
);
export default banners;
